<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/BasicTemplate.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Rewired Documentation | Controllers</title>
<!-- InstanceEndEditable -->
<!-- InstanceParam name="isRoot" type="boolean" value="false" -->
<!-- InstanceParam name="wide" type="boolean" value="false" -->
<link href="files/css/styles.css" rel="stylesheet" type="text/css" />
<!-- Favicons -->
<link rel="icon" type="image/x-icon" href="/projects/rewired/files/images/favicon.ico?v=1" />
<!-- Apple Icons -->
<!-- For iPad with high-resolution Retina display running iOS = 7: -->
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="files/images/favicon_152x152.png?v=1">
<!-- For iPad with high-resolution Retina display running iOS = 6: -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="files/images/favicon_144x144.png?v=1">
<!-- For iPhone with high-resolution Retina display running iOS = 7: -->
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="files/images/favicon_120x120.png?v=1">
<!-- For iPhone with high-resolution Retina display running iOS = 6: -->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="files/images/favicon_114x114.png?v=1">
<!-- For the iPad mini and the first- and second-generation iPad on iOS = 7: -->
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="files/images/favicon_76x76.png?v=1">
<!-- For the iPad mini and the first- and second-generation iPad on iOS = 6: -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="files/images/favicon_72x72.png?v=1">
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
<link rel="apple-touch-icon-precomposed" href="files/images/favicon_57x57.png?v=1">
</head>

<body>


<div class="container">

    <div class="google-search-bar">
        <script>
          (function() {
            var cx = '007961148920562332911:oocvtwz5jce';
            var gcse = document.createElement('script');
            gcse.type = 'text/javascript';
            gcse.async = true;
            gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(gcse, s);
          })();
        </script>
        <gcse:search></gcse:search>
    </div>

  <div class="content">
	
	
	 
    <div class="page-body">
	
    
         
	    
      	<div class="sidebar-nav">
	        <h4><a href="Documentation.html">Documentation</a></h4>
	        <ul>
	          <li><a href="Overview.html">Overview</a></li>
	          <li><a href="ReleaseNotes.txt">Release Notes</a></li>
          </ul>
	        <strong>Essentials:</strong>
            <ol>
              <li><a href="Installation.html">Installation</a></li>
              <li><a href="QuickStart.html">Quick Start</a></li>
              <li><a href="BasicUsage.html">Basic Usage</a></li>
              <li><a href="Deployment.html">Deployment</a></li>
              <li><a href="BestPractices.html">Best Practices</a></li>
              <li><a href="RewiredEditor.html">Rewired Editor</a></li>
              <li><a href="https://guavaman.com/projects/rewired/docs/api-reference" target="_blank">API Reference</a></li>
            </ol>
            <strong>Concepts:</strong>
            <ul>
              <li><a href="InputManager.html">Input Manager</a></li>
              <li><a href="Players.html">Players</a></li>
              <li><a href="Actions.html">Actions</a></li>
              <li><a href="InputBehaviors.html">Input Behaviors</a></li>
              <li><a href="Controllers.html">Controllers</a></li>
              <li><a href="ControllerMaps.html">Controller Maps</a></li>
              <li><a href="ControllerTemplates.html">Controller Templates</a></li>
              <li><a href="MapCategories.html">Map Categories</a></li>
              <li><a href="Layouts.html">Layouts</a></li>
              <li><a href="LayoutManager.html">Layout Manager</a></li>
              <li><a href="MapEnabler.html">Map Enabler</a></li>
              <li><a href="CustomControllers.html">Custom Controllers</a></li>
            </ul>
            <strong>Extras:</strong>
            <ul>
              <li><a href="ControlMapper.html" title="Control Mapper">Control Mapper</a></li>
	          <li><a href="TouchControls.html" title="Touch Controls">Touch Controls</a></li>
              <li><a href="RewiredStandaloneInputModule.html">Rewired Standalone Input Module</a></li>
	          <li><a href="UnityInputOverride.html" title="Unity Input Override">Unity Input Override</a></li>
            </ul>
            <strong>Misc:</strong>
            <ul>
	          <li><a href="ComponentControls.html" title="Component Controls">Component Controls</a></li>
	          <li><a href="PlayerControllers.html" title="Player Controllers">Player Controllers</a></li>
	          <li><a href="InputMapper.html" title="Input Mapper">Input Mapper</a></li>
	          <li><a href="UserDataStore.html" title="User Data Store">User Data Store</a></li>
            </ul>
            <strong>How To's:</strong>
            <ul>
            	<li><a href="HowTos.html">See all topics...</a></li>
            </ul>
            <strong>Help:</strong>
            <ul>
              <li><a href="SupportedControllers.html" title="Supported Controllers">Supported Controllers</a></li>
              <li><a href="Overview.html#tested-platforms" title="Tested Platforms">Tested Platforms</a></li>
              <li><a href="Troubleshooting.html" title="Troubleshooting">Troubleshooting</a></li>
              <li><a href="KnownIssues.html">Known Issues</a></li>
              <li><a href="SpecialPlatformSupport.html" title="Special Platform Support">Special Platform Support</a></li>
	          <li><a href="Examples.html" title="Examples">Examples</a></li>
              <li><a href="Integration.html">Integrations</a></li>
	          <li><a href="Updating.html" title="Updating Rewired">Updating Rewired</a></li>
            </ul>
            <strong>FAQ</strong>
            <ul>
            	<li><a href="FAQ.html">See all topics...</a></li>
            </ul>
            <strong>Unity Help:</strong>
            <ul>
              <li><a href="https://docs.unity3d.com/Manual/" target="_blank">Unity Manual</a></li>
              <li><a href="https://docs.unity3d.com/ScriptReference/" target="_blank">Unity Script Reference</a></li>
              <li><a href="https://unity3d.com/learn/tutorials/modules" target="_blank">Unity Tutorials</a></li>
            </ul>
            <strong>Links:</strong>
            <ul>
              <li><a href="https://guavaman.com/projects/rewired">Rewired Website</a></li>
              <li><a href="https://guavaman.com/projects/rewired/docs">Web Documentation</a></li>
            </ul>
        </div>
        
    
    	<div class="main-body">
	        <div class="logo"><a href="https://guavaman.com/projects/rewired" title="Rewired"><img src="files/images/rewired-logo.png" width="173" height="139" alt="Rewired" /></a></div>
                     
            <h1>
            <!-- InstanceBeginEditable name="PageHeader" -->Controllers
      <!-- InstanceEndEditable -->
            </h1>
            
			<!-- InstanceBeginEditable name="MainBody" -->
    <p>A Controller is a virtual object that represents a physical or virtual controller of some type. Each Controller object contains a list of elements (buttons, axes, etc.) each of which represents a physical or virtual element on a controller. While you can access element input values directly from the Controller object, generally there is little reason to do this in Rewired because you normally access input through Rewired's <a href="Players.html">Player</a>-based, <a href="Actions.html">Action</a>-driven input system instead.</p>
    <h3><a name="controller-types" id="joysticks2"></a>Controller Types</h3>
    <p>The  controller types in Rewired are:</p>
    <ul>
      <li><a href="#joysticks">Joysticks</a></li>
      <li><a href="#keyboard">Keyboard</a></li>
      <li><a href="#mouse">Mouse</a></li>
      <li><a href="#custom-controllers">Custom Controllers</a></li>
    </ul>
    <p>Different controller types have some differences in the way they are used by Players to determine input values.</p>
    <h3><a name="joysticks" id="joysticks"></a>Joysticks</h3>
    <p>Joysticks are the most common Controller type and include most external non-mouse, non-keyboard USB or Bluetooth input peripherals that are connected to the system. (Certain exotic device types cannot be seen as Joysticks by Rewired.) Joysticks may come in various forms such as gamepads, flight sticks, steering wheels, balance boards, etc.</p>
    <p>When a controller is attached to the system, Rewired will attempt to identify that controller and load a hardware definition. If a hardware definition is found, it will have human-readable element names, standardized axis directions, can have default mappings created for it in the Rewired Editor so your players can just connect and go, and even may be compatible with a <a href="ControllerTemplates.html">Controller Template</a> for even quicker mapping. Please see <a href="SupportedControllers.html">Supported Controllers</a> for more information about recognized controllers. For all other controllers that are not recognized, <a href="SupportedControllers.html#controllers-without-definitions">see this for more information</a>.</p>
    <p><strong><a name="joystick-assignment" id="joysticks3"></a>Joystick Assignment</strong><br />
      In order to use a Joystick in Rewired's Player-based system, first the Player which should be in control of the Joystick must have that joystick assigned. (<a href="#joystick-auto-assignment">See Joystick Auto-Assignment</a>.) Once the Joystick is assigned to the Player, Rewired will attempt to load any Joystick Maps for that Player from the defaults assigned to the Player in the Rewired Input Manager for the particular Joystick in question. The Player will then use that Joystick as one of its input sources when calculating the values of its input Actions provided the Player also has one or more Joystick Maps which map joystick elements to Actions. (<a href="ControllerMaps.html">See Controller Maps for more information</a>.) A Player may have any number of Joysticks assigned, and Joysticks may be shared among any number of Players (this is rare.)</p>
<p>Joysticks can be assigned and removed from a Player via scripting (<a href="HowTos.html#assigning-joysticks">see here for more information</a>), but it is more common to allow Rewired to automatically assign Joysticks to Players.</p>
    <p><a name="joystick-auto-assignment" id="joysticks4"></a><strong>Joystick Auto-Assignment</strong></p>
    <p>By default, Joysticks will be assigned to Players (excluding the System Player) automatically based on the Joystick Auto-Assignment settings in the <a href="https://guavaman.com/projects/rewired/docs/RewiredEditor.html#Settings">Rewired Editor - Settings</a>. These settings allow you to change various options for how Joysticks are auto-assigned to Players based on the needs of your game. Joystick auto-assignment can be disabled if you'd prefer to <a href="HowTos.html#assigning-joysticks">assign joysticks manually through scripting</a>. Joystick auto-assignment can also be <a href="RewiredEditor.html#Players">selectively disabled per player in the Rewired Editor</a> and <a href="https://guavaman.com/projects/rewired/docs/api-reference/html/P_Rewired_Player_ControllerHelper_excludeFromControllerAutoAssignment.htm">via scripting</a>.</p>
    <p>Note: One common issue that arises is when you connect multiple controllers and want a single Player to be able to use any of the connected controllers. Based on the default settings, Rewired will assign only one controller per-Player. In order to allow auto-assignment of multiple Joysticks to the same Player, Max Joysticks Per Player must be raised to a value greater than 1. All these settings are configurable and have descriptions as to their function.</p>
    <p><strong><a name="joystick-maps" id="joysticks5"></a>Joystick Maps</strong><br />
  Please see <a href="ControllerMaps.html#joystick-maps">Controller Maps - Joystick Maps</a> for more information. </p>
    <p><strong><a name="joystick-events" id="joysticks6"></a>Joystick Connect and Disconnect Events</strong><br />
      You can detect when a Joystick is connected or disconnected through the use of events. <a href="HowTos.html#connect-disconnect-events">See How To's - Receiving joystick connect and disconnect events</a> for more information.</p>
    <p><strong><a name="detecting-joysticks-at-start" id="joysticks13"></a>Checking for Joysticks at the Start of the Game</strong></p>
    <p>Please see <a href="https://guavaman.com/projects/rewired/docs/HowTos.html#connect-disconnect-events">How To's - Receiving Joystick connect and disconnect events</a> for important information.</p>
    <p><strong><a name="identifying-joysticks-by-type" id="identifying-joysticks-by-type"></a>Identifying Joysticks</strong></p>
    <p>Please see <a href="HowTos.html#https://guavaman.com/projects/rewired/docs/HowTos.html#identifying-recognized-controllers">How To's - Identifying recognized Joysticks.</a></p>
    <p>&nbsp;</p>
<hr />
    <h3><strong><a name="keyboard" id="joysticks7"></a></strong>Keyboard</h3>
    <p>The keyboard works similarly to Joysticks in many ways, but there are a few notable differences:</p>
    <ul>
      <li>At the present time, Rewired only supports a single, universal keyboard. Multiple keyboards attached to the system will simply act as a single keyboard.</li>
      <li>Keyboards do not send connect/disconnect events.</li>
      </ul>
    <p><strong><a name="keyboard-assignment" id="joysticks14"></a>Keyboard Assignment</strong><br />
Similar to Joysticks, the Keyboard must be assigned to a Player before that Player can use it for input. However, the method of assigning the Keyboard to a Player differs from Joysticks.</p>
    <p>To allow a Player access to the keyboard at the start of your game, you should ensure that &quot;Assign Keyboard on Start&quot; is checked in the <a href="RewiredEditor.html#Players">Rewired Editor - Players</a> page. (The keyboard is assigned to all Players on start by default.)</p>
    <p>To assign the keyboard manually via scripting:</p>
    <ul>
      <li><a href="https://guavaman.com/projects/rewired/docs/api-reference/html/P_Rewired_Player_ControllerHelper_hasKeyboard.htm">player.controllers.hasKeyboard</a> - Set to True to give the Player access to the keyboard.</li>
    </ul>
    <p><strong><a name="keyboard-maps" id="joysticks8"></a>Keyboard Maps</strong><br />
      Like Joysticks, a Player will only be able to return input values for keyboard keys if the Player has one or more enabled Keyboard Maps assigned. Please see <a href="ControllerMaps.html#keyboard-maps">Controller Maps - Keyboard Maps</a> for more information.</p>
    <p>&nbsp; </p>
    <hr />
    <h3><strong><a name="mouse" id="joysticks9"></a></strong>Mouse</h3>
    <p>The mouse also works similarly to Joysticks in many ways, but there are a few notable differences:</p>
    <ul>
      <li>At the present time, Rewired only supports a single, universal mouse. Multiple mice attached to the system will simply act as a single mouse.</li>
      <li>Mice do not send connect/disconnect events.</li>
      </ul>
    <p><strong><a name="mouse-assignment" id="joysticks11"></a>Mouse Assignment</strong><br />
      Similar to Joysticks, the Mouse must be assigned to a Player before that Player can use it for input. However, the method of assigning the Mouse to a Player differs from Joysticks.</p>
<p>To allow a Player access to the mouse at the start of your game, you should check &quot;Assign Mouse on Start&quot; in the <a href="RewiredEditor.html#Players">Rewired Editor - Players</a> page.</p>
<p>To assign the mouse manually via scripting:</p>
<ul>
  <li><a href="https://guavaman.com/projects/rewired/docs/api-reference/html/P_Rewired_Player_ControllerHelper_hasMouse.htm">player.controllers.hasMouse</a> - Set to True to give the Player access to the mouse.</li>
</ul>
<p><strong><a name="keyboard-maps" id="joysticks10"></a>Mouse Maps</strong><br />
      Like Joysticks and the Keyboard, a Player will only be able to return input values for mouse input if the Player has one or more enabled Mouse Maps assigned. Please see <a href="ControllerMaps.html#mouse-maps">Controller Maps - Mouse Maps</a> for more information. </p>
<p>&nbsp;</p>
<hr />
<h3><strong><a name="custom-controllers" id="joysticks12"></a></strong>Custom Controllers</h3>
<p>Please see <a href="CustomControllers.html">Custom Controllers</a> for more information.</p>
<p>&nbsp;</p>
<hr />
<h3><a name="enabling-and-disabling" id="enabling-and-disabling"></a>Enabling / Disabling</h3>
<p>All Controllers can be enabled or disabled via scripting by setting the Controller.enabled property. Disabled Controllers do not generate any input.</p>
<div class="bottom-pager clearfix">
  <a class="back-button" href="InputBehaviors.html" title="Input Behaviors"><span class="button-img"></span>Input Behaviors</a>
  <a class="forward-button" href="ControllerMaps.html" title="Map Categories"><span class="button-img"></span>Controller Maps</a>
</div>
<!-- InstanceEndEditable -->
        </div>
        
    </div>
  <div class="footer clearfix">
   	<p class="left">Copyright &copy;2014-2021 <a href="https://guavaman.com" title="Guavaman Enterprises">Guavaman Enterprises</a>. All rights reserved. No materials may be reproduced without permission.</p>
  	<p class="right"><a href="https://guavaman.com/projects/rewired" title="Return to Rewired Website">Return to Rewired Website</a></p>
  </div>
  <!-- end .content --></div>
  <!-- end .container --></div>
  
  
</body>
<!-- InstanceEnd --></html>
